package com.w_resume.todo;

import java.sql.Connection;
import java.sql.Date;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

public class writeToTxt_jdbc {

	public static Integer id;
	public static String estimateTrade;
	public static String name;
	public static String nickname;
	public static Integer sex;
	public static String telephone;
	public static String email;
	public static String icon;
	public static Date birthday;
	public static Integer marriageStatus;
	public static String address;
	public static Integer evection;
	public static Integer overtime;
	public static String majorSkills;
	public static String secondary;
	public static String expProj;
	public static String expectArea;
	public static String expectOccupation;
	public static Integer expectSalaryMonthLow;
	public static Integer expectSalaryMonthHigh;
	public static Integer currentSalaryYearLow;
	public static Integer currentSalaryYearHigh;
	public static String expectIndustry;
	public static Integer expectWorkNature;
	public static Integer currentStatus;
	public static Integer jobState;
	public static String selfEvaluationTag;
	public static String selfEvaluation;
	public static Integer userId;
	public static Integer states;
	public static Date createTime;
	public static Date updateTime;
	public static Integer createUser;
	public static Integer updateUser;
	public static Date resumeUpdateTime;
	public static String resumeKeyWord;
	public static String resumeId;
	public static Date firstWorkTime;
	public static String household;
	public static String residence;
	public static String idCard;
	public static String dutyTime;
	public static String otherMessage;
	public static String company;
	public static Integer companyLevel;
	public static Integer degree;
	public static Integer estimatePrice;
	public static String school;
	public static Integer schoolLevel;
	public static String skillKeyword;
	public static String birthStatus;
	public static String source;
	public static Date lastWorkTime;
	public static Integer crawldbid;
	public static Integer score;
	public static Short isValid;
	public static Integer isIt;
	public static String major;
	public static Short resumeFrom;
	public static Integer completePercent;
	public static String comFullname;
	public static Integer dup;
	public static String resumePath;
	public static Integer cmscheck;
	public static Integer cmstag1;
	public static Integer format;
	public static Integer isActive;
	public static String cAge;
	public static String cWorkExperience;
	public static String cExpectSalary;
	public static String cCurrentSalaryYear;
	public static String cPoliticsStatus;
	public static String cFilename;
	public static String cWorkshowurl;
	public static String cSocialHistory;
	public static String cCurrentIndustry;
	public static String cCurrentCompany;
	public static String cLastloginTime;
	public static String cCurrentPay;
	public static String cApplyInfo;
	public static String interest;
	public static String certificate;
	public static String honor;
	public static String cWorkHistory;
	public static String cProjectHistory;
	public static String cEducationHistory;
	public static String cTrainingHistory;
	public static String cLanguageAbility;
	public static String cProfessionSkill;
	public static String resumeIconPath;
	public static Byte areaBj;
	public static Byte handleState;
	public static Date setActiveTime;
	public static String resumeName;
	public static String idcode; 

	public static Connection getConnection() {
		String user = "root";
		String password = "hunter";
		String url = "jdbc:mysql://123.57.35.10:3306/honestcareer??characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true";
		String driver = "com.mysql.jdbc.Driver";
		Connection con = null;
		try {
			Class.forName(driver);
			con = DriverManager.getConnection(url, user, password);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		return con;

	}

	public static void getDbSize() {
		long start = System.currentTimeMillis();
		String sql = "select *from w_resume_final where id>20 and id<10000 ";
		Connection con = getConnection();
		try {

			PreparedStatement ps = con.prepareStatement(sql);
			ResultSet rs = ps.executeQuery();
			while (rs.next()) {
				System.out.println(rs.getInt(1));
			}

		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		long end = System.currentTimeMillis();
		System.out.println(end - start);

	}

	public static void main(String[] args) {

		getDbSize();
	}

}
